package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.AttendanceRecordMapper;
import cn.classyex.business.hr.domain.AttendanceRecord;
import cn.classyex.business.hr.service.IAttendanceRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 考勤记录管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class AttendanceRecordServiceImpl implements IAttendanceRecordService 
{
    @Autowired
    private AttendanceRecordMapper attendanceRecordMapper;

    /**
     * 查询考勤记录管理
     * 
     * @param attendanceId 考勤记录管理ID
     * @return 考勤记录管理
     */
    @Override
    public AttendanceRecord selectAttendanceRecordById(Long attendanceId)
    {
        return attendanceRecordMapper.selectAttendanceRecordById(attendanceId);
    }

    /**
     * 查询考勤记录管理列表
     * 
     * @param attendanceRecord 考勤记录管理
     * @return 考勤记录管理
     */
    @Override
    public List<AttendanceRecord> selectAttendanceRecordList(AttendanceRecord attendanceRecord)
    {
        return attendanceRecordMapper.selectAttendanceRecordList(attendanceRecord);
    }

    /**
     * 新增考勤记录管理
     * 
     * @param attendanceRecord 考勤记录管理
     * @return 结果
     */
    @Override
    public int insertAttendanceRecord(AttendanceRecord attendanceRecord)
    {
        attendanceRecord.setCreateTime(DateUtils.getNowDate());
        return attendanceRecordMapper.insertAttendanceRecord(attendanceRecord);
    }

    /**
     * 修改考勤记录管理
     * 
     * @param attendanceRecord 考勤记录管理
     * @return 结果
     */
    @Override
    public int updateAttendanceRecord(AttendanceRecord attendanceRecord)
    {
        attendanceRecord.setUpdateTime(DateUtils.getNowDate());
        return attendanceRecordMapper.updateAttendanceRecord(attendanceRecord);
    }

    /**
     * 删除考勤记录管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAttendanceRecordByIds(String ids)
    {
        return attendanceRecordMapper.deleteAttendanceRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除考勤记录管理信息
     * 
     * @param attendanceId 考勤记录管理ID
     * @return 结果
     */
    @Override
    public int deleteAttendanceRecordById(Long attendanceId)
    {
        return attendanceRecordMapper.deleteAttendanceRecordById(attendanceId);
    }
}
